<?php


/**
* Puree CMS
* http://www.molotsoft.ru
*
* @package Puree_CMS
* @subpackage Admin/Elements
* @author Ivan Chistyakov <ivan@molotsoft.ru>
* @version $Id: admin_sidebar.ctp 1012 2010-03-19 13:06:52Z molotsoft@gmail.com $
* @link $HeadURL: http://puree-cms.googlecode.com/svn/trunk/plugins/admin/views/elements/layouts/admin_sidebar.ctp $
*/


$modules = Configure::read('Project.modules');


?>
<div class="admin_sidebar_buttons">
<?php if ((bool)$session->read('Auth.User')) { ?>
<div class="admin_sidebar_button"><?php echo $html->link($routine->icon('house'), array('controller' => 'users', 'action' => 'welcome'), array('title' => __('welcome_module', TRUE)), FALSE, FALSE); ?>&nbsp;<?php echo $html->link(__('welcome_module', TRUE), array('controller' => 'users', 'action' => 'welcome')); ?></div>
<div class="admin_sidebar_button_separator"><!-- &nbsp; --></div>
<?php if (is_array($modules)) foreach ($modules as $module_name => $module_description) { ?>
<div class="admin_sidebar_button"><?php echo $html->link($routine->icon($module_description['icon']), $module_description['url'], array('title' => __($module_description['title'], TRUE)), FALSE, FALSE); ?>&nbsp;<?php echo $html->link(__($module_description['title'], TRUE), $module_description['url']); ?></div>
<?php } ?>
<div class="admin_sidebar_button_separator"><!-- &nbsp; --></div>
<div class="admin_sidebar_button"><?php echo $html->link($routine->icon('door_out'), array('controller' => 'users', 'action' => 'logout'), array('title' => __('logout_action', TRUE)), FALSE, FALSE); ?>&nbsp;<?php echo $html->link(__('logout_action', TRUE), array('controller' => 'users', 'action' => 'logout')); ?></div>
<?php } else { ?>
<div class="admin_sidebar_button"><?php echo $html->link($routine->icon('house'), array('controller' => 'users', 'action' => 'login'), array('title' => __('login_module', TRUE)), FALSE, FALSE); ?>&nbsp;<?php echo $html->link(__('login_module', TRUE), array('controller' => 'users', 'action' => 'login')); ?></div>
<?php } ?>
</div>